<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wages', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('assign')->nullable()->comment('归属者');
            $table->string('rank')->nullable()->comment('职级');
            $table->string('salary')->nullable()->comment('薪水');
            $table->timestamp('month')->nullable()->comment('薪资月份');
            $table->string('kpi_result')->nullable()->comment('KPI结果');
            $table->unsignedInteger('kpi_bonus')->default(0)->comment('KPI奖金');
            $table->unsignedInteger('kpi_money')->default(0)->comment('KPI提成');
            $table->unsignedInteger('add_money1')->default(0)->comment('加班费');
            $table->unsignedInteger('add_money2')->default(0)->comment('推荐奖金');
            $table->unsignedInteger('add_money3')->default(0)->comment('节庆礼金');
            $table->unsignedInteger('add_money4')->default(0)->comment('生日礼金');
            $table->unsignedInteger('add_money5')->default(0)->comment('房补');
            $table->unsignedInteger('add_money6')->default(0)->comment('餐补');
            $table->unsignedInteger('add_money7')->default(0)->comment('话费补贴');
            $table->unsignedInteger('add_money8')->default(0)->comment('入职机票');
            $table->unsignedInteger('add_money9')->default(0)->comment('入职签证');
            $table->unsignedInteger('add_money10')->default(0)->comment('年假折现');
            $table->unsignedInteger('add_money11')->default(0)->comment('年度机票');
            $table->unsignedInteger('add_money12')->default(0)->comment('年度医补');
            $table->string('add_option1')->nullable()->comment('13薪基数');
            $table->unsignedInteger('add_money13')->default(0)->comment('年度13薪');
            $table->unsignedInteger('add_money14')->default(0)->comment('其他补发');
            $table->string('cut_option1')->nullable()->comment('总出勤数');
            $table->string('cut_option2')->nullable()->comment('实际出勤');
            $table->string('cut_option3')->nullable()->comment('迟到次数');
            $table->unsignedInteger('cut_money1')->default(0)->comment('迟到扣款');
            $table->string('cut_option4')->nullable()->comment('病假天数');
            $table->unsignedInteger('cut_money2')->default(0)->comment('病假扣款');
            $table->string('cut_option5')->nullable()->comment('事假天数');
            $table->unsignedInteger('cut_money3')->default(0)->comment('事假扣款');
            $table->string('cut_option6')->nullable()->comment('旷工天数');
            $table->unsignedInteger('cut_money4')->default(0)->comment('旷工扣款');
            $table->unsignedInteger('cut_money5')->default(0)->comment('房租扣款');
            $table->unsignedInteger('cut_money6')->default(0)->comment('水电费');
            $table->unsignedInteger('cut_money7')->default(0)->comment('网费');
            $table->unsignedInteger('cut_money8')->default(0)->comment('五险一金');
            $table->unsignedInteger('cut_money9')->default(0)->comment('其他扣款');
            $table->tinyInteger('status')->default(1)->index()->comment('状态：-1删除，0审核/禁用，1启用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wages');
    }
}
